package com.sias.sogra;

import com.sias.spring.mybatis.MapperScan;
import com.sias.spring.mybatis.SograImportBeanDefinitionRegister;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author 吴文杰
 * @version 1.0
 * @createTime 2023-05-30 14:17:15
 */
@ComponentScan("com.sias.sogra")
@MapperScan("com.sias.sogra.mapper")
public class AppConfig {

  @Bean
  public SqlSessionFactory sqlSessionFactory() throws IOException {
    InputStream is = Resources.getResourceAsStream("mybatis.xml");
    return new SqlSessionFactoryBuilder().build(is);
  }

}
